// 主界面
;define(function(require, exports, module) {
    'use strict';
    var util = require("util");
    var base = require("base");
    var router = require("../hash/pageRouter");
    var css_this = require("./deliveryRecord.css");
    var dialog = require("dialog");
    var validate = require("validate");
    var pageIndex = 1,
        pageSize = 10,
        totalPageCount = 1,
        totalRecordCount = 0; //分页初始化
    var imgSrc;
    var init = function(num){
		initEvent();
		router.init();
		$("#leftMenu1").find(".leftMenu-item").removeClass("leftMenu-active");
		$("#leftMenu1 #undoneTaskList").parent(".leftMenu-item").addClass("leftMenu-active");
    };
	var initEvent = function(){
		
		$(".page-header").on("click","a",function(){
			var path = $(this).attr("id");
			router.route("cargoTaskList/"+path+".html");
		});
		
		$(".page-content").on("click","#cargoDetail",function(){
			var path = $(this).attr("id");
			router.route("cargoTaskList/"+path+".html");
		});
		
		$(".page-content-main").on("click","#generateDelivery",function(){
			var path = $(this).attr("id");
			router.route("cargoTaskList/"+path+".html");
		});
		
		$(".page-content").on("click",".handle-detail",function(){
			var va = $(this).parents(".table-base-body-item").attr("id");
			$(this).parents(".table-base-body").find(".children_"+va).toggle();
		});
    };
    
    return {
        init:init
    };
});